function repeatStringNumTimes(str, num) {
    // repeat after me
    return num > 0
        ? Array(num)
              .fill(str)
              .join("")
        : "";
}

repeatStringNumTimes("abc", 3);
